﻿#ifndef CERTIFICATECENTER_H
#define CERTIFICATECENTER_H

#include <QWidget>
#include "certcontent.h"
#include "registerhotel.h"
#include "hotelcertmodel.h"

namespace Ui {
class CertificateCenter;
}

class CertificateCenter : public QWidget
{
    Q_OBJECT

signals:
    void signalGainHotelDetails(const QString&);
    void signalHotelPassCert(bool,const QString&);
    void signalRefrushCertList(int);
    void signalPassCert(bool,const QString&);

public:
    explicit CertificateCenter(QWidget *parent = nullptr);
    ~CertificateCenter();

    int getCurrentIndex();
    void setCurentIndex(int index);
    void setHotelDetails();
    void errorShow(const QString& msg);
    void cleanUserCertList();

public slots:
    void slotRefreshHotelCertList();
    void slotHotelImage();
    void slotHotelCertResult(bool,const QString&);
    void slotUserCertList(bool,const QString&);
    void slotUserCertResult(bool,const QString&);
    void slotSetUserCertImage(bool result, const QString& msg, const QImage&image);

private slots:
    void on_tabv_hotelCert_doubleClicked(const QModelIndex &index);

private:
    Ui::CertificateCenter *ui;

    RegisterHotel *m_hotelDetails;
    HotelCertModel *m_hotelModel;
    QVector<CertContent *> m_idCertVector;
};

#endif // CERTIFICATECENTER_H
